package com.gt.xmall.service;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;


import com.gt.xmall.service.BaseService;

import com.gt.xmall.model.GtdTopic;
import com.gt.xmall.repository.GtdTopicDao;



@Component
@Transactional(readOnly = true)
public class GtdTopicService extends BaseService{
	@Autowired
	private GtdTopicDao gtdTopicDao;
	
	public List<GtdTopic> getGtdTopics(){
		return (List<GtdTopic>)gtdTopicDao.findAll();
	}
	
	public GtdTopic getGtdTopic(Long id){
		return gtdTopicDao.findOne(id);
	}
	@Transactional(readOnly = false)
	public GtdTopic saveGtdTopic(GtdTopic gtdTopic){
		return gtdTopicDao.save(gtdTopic);
	}
	
	@Transactional(readOnly = false)
	public void deleteGtdTopic(Long id){
		 gtdTopicDao.delete(id);
	}
	
}